import { fetch } from '@/little/fetch';

export const goodsCategory = () => fetch.get('/v1/goods/category');
export const goodsList = (category = 1, page = 1, size = 10) => fetch.get('/v1/goods/basic', { category, page, size });
export const goodsInfo = (id) => fetch.get(`/v1/goods/basic/${id}`);

export const goodsCartList = (page = 1, size = 10) => fetch.get(`/v1/goods/cart`, { page, size });
export const goodsCartAdd = (meta) => fetch.post(`/v1/goods/cart`, { meta });
export const goodsCartUp = (id, meta) => fetch.put(`/v1/goods/cart/${id}`, { meta });
export const goodsCartDel = (id) => fetch.delete(`/v1/goods/cart/${id}`);

export const goodsCollectList = (type = 0, page = 1, size = 10) => fetch.get(`/v1/goods/collect`, { type, page, size });
export const goodsCollectAdd = (meta) => fetch.post(`/v1/goods/collect`, { meta });
export const goodsCollectUp = (id, meta) => fetch.put(`/v1/goods/collect/${id}`, { meta });
export const goodsCollectDel = (id) => fetch.delete(`/v1/goods/collect/${id}`);
